package com.qf.domain;


import org.hibernate.validator.constraints.NotBlank;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
//为了防止断电等突发状况所导致数据丢失，设置了一种接口，这种接口实现对对象象流深度拷贝到堆内存，不至于丢失，下次会自动获取
//书籍详情
public class EbookEntry  implements Serializable {

	private Integer id;
	@NotNull(message = "分类id不能为空")
	private Integer categoryId;//图书分类
	@NotBlank(message = "书名不能为空")
	private String title;//图书名称

	private String summary;//摘要

	private String uploaduser; //上传人
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	@NotNull(message = "时间不能为空")
	private Date createdate;//时间

	public EbookEntry() {
	}

	public EbookEntry(Integer id, Integer categoryId, String title, String summary, String uploaduser, Date createdate) {
		this.id = id;
		this.categoryId = categoryId;
		this.title = title;
		this.summary = summary;
		this.uploaduser = uploaduser;
		this.createdate = createdate;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Integer getCategoryId() {
		return categoryId;
	}

	public void setCategoryId(Integer categoryId) {
		this.categoryId = categoryId;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getSummary() {
		return summary;
	}

	public void setSummary(String summary) {
		this.summary = summary;
	}

	public String getUploaduser() {
		return uploaduser;
	}

	public void setUploaduser(String uploaduser) {
		this.uploaduser = uploaduser;
	}

	public Date getCreatedate() {
		return createdate;
	}

	public void setCreatedate(Date createdate) {
		this.createdate = createdate;
	}

	@Override
	public String toString() {
		return "EbookEntry{" +
				"id=" + id +
				", categoryId=" + categoryId +
				", title='" + title + '\'' +
				", summary='" + summary + '\'' +
				", uploaduser='" + uploaduser + '\'' +
				", createdate=" + createdate +
				'}';
	}
}
